<template>
  <el-button :type="type" v-bind="$attrs">
    <template v-for="(data, name) in slots" :key="name">
      <slot :name="name" v-bind="data" />
    </template>
  </el-button>
</template>

<script lang="ts">
import { useSlots } from "vue";
export default {
  name: "WSButton",
  props: {
    type: {
      type: String,
      default: "primary",
      validator: (value: string) =>
        ["primary", "success", "warning", "danger"].includes(value),
    },
  },
  setup() {
    const slots = useSlots();
    return {
      slots,
    };
  },
};
</script>
